package com.orphan.supplier.mapper;

import com.orphan.supplier.po.RealSupplier;
import com.orphan.supplier.po.Supplier;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author jack
 * @since 2021-07-20
 */
@Mapper
public interface SupplierMapper extends BaseMapper<RealSupplier> {
    @Select("select * from t_supplier")
    List<RealSupplier> getAll();
//    @Update("update t_supplier  ")
//    int update();
    @Insert("insert into t_supplier (username,password,gender,tel,idPic,brand,licensePic,ranks,status) values(#{username},#{password},#{gender},#{tel},#{idPic},#{brand},#{licensePic},#{ranks},#{status})")
    int insert(RealSupplier realSupplier);
    @Select("select password from t_supplier where username = #{username}")
    String check(String username);
}
